package cn.com.liu.forkjoin;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
 
public class MainTest {
    public static void main(String[] args) {
        MyTask mt = new MyTask(1,1000);
 
        ForkJoinPool forkJoinPool = new ForkJoinPool();
 
        Future<Integer> result = forkJoinPool.submit(mt);
 
        try {
            System.out.println(result.get());
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
 
        forkJoinPool.shutdown();
    }
}
